<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
	</head>
	<body>
		<div class="input" id='input' contenteditable>
			
		</div>
		<script type="text/javascript">
			function vodChangeUrl2Local(match){
		   var code = '';
			switch(match){
				case "【太快了】":
				 code = match.replace(match,'<img src="/assets/img/emotion/feedback.quickly.png">');
					break;
				case "【太慢了】":
					code = match.replace(match,'<img src="/assets/img/emotion/feedback.slowly.png">');
					break;
				case "【赞同】":
					code = match.replace(match,'<img src="/assets/img/emotion/emotion.nod.png">');
					break;
				case "【反对】":
					code = match.replace(match,'<img src="/assets/img/emotion/feedback.against.png">');
					break;
				case "【鼓掌】":
					code = match.replace(match,'<img src="/assets/img/emotion/feedback.applaud.png">');
					break;
				case "【值得思考】":
					code = match.replace(match,'<img src="/assets/img/emotion/feedback.think.png">');
					break;
				case "【礼物】":
					code = match.replace(match,'<img src="/assets/img/emotion/chat.gift.png">');
					break;
				case "【愤怒】":
					code = match.replace(match,'<img src="/assets/img/emotion/emotion.angerly.png">');
					break;
				case "【鄙视】":
					code = match.replace(match,'<img src="/assets/img/emotion/emotion.bs.png">');
					break;
				case "【伤心】":
					code = match.replace(match,'<img src="/assets/img/emotion/emotion.cry.png">');
					break;
				case "【再见】":
					code = match.replace(match,'<img src="/assets/img/emotion/emotion.goodbye.png">');
					break;
				case "【高兴】":
					code = match.replace(match,'<img src="/assets/img/emotion/emotion.laugh.png">');
					break;
				case "【流汗】":
					code = match.replace(match,'<img src="/assets/img/emotion/emotion.lh.png">');
					break;
				case "【无聊】":
					code = match.replace(match,'<img src="/assets/img/emotion/emotion.nod.png">');
				  break;
				case "【疑问】":
					code = match.replace(match,'<img src="/assets/img/emotion/emotion.question.png">');
					break;
				case "【你好】":
					code = match.replace(match,'<img src="/assets/img/emotion/emotion.smile.png">');
					break;
				case "【凋谢】":
					code = match.replace(match,'<img src="/assets/img/emotion/rose.down.png">');
					break;
				case "【鲜花】":
					code = match.replace(match,'<img src="/assets/img/emotion/rose.up.png">');
					break;
				default:
			}
			return code
		}
				// 传值匹配
		function vodEmotion2Local(richText){
			richText = richText.replace( /【[\u4e00-\u9fa5]+】/gi, function (match, capture) {
				return vodChangeUrl2Local(match);
			});
			return richText;
			// return richText.replace(/color: rgb(0, 0, 0);/gi,'').replace(/COLOR: #000000;/gi,'').replace(/color: rgb(92, 92, 92);/gi,'').replace(/COLOR: #5c5c5c;/gi,'').replace(/<font color=#[^>]+>/ig, "").replace(/<\/font>/ig, "");
		}
		var str = '你好啊【鄙视】【凋谢】啦啦啦~'	 
		var newStr = vodEmotion2Local(str)
		console.log(newStr);
		</script>
	</body>
</html>